package com.itheima.util;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisUtils {
    public static Jedis getJedis(){
        JedisPoolConfig jpc = new JedisPoolConfig();
        jpc.setMaxTotal(30);
        jpc.setMaxIdle(10);
        String host="127.0.0.1";
        int port=6379;
        JedisPool jp = new JedisPool(jpc, host, port);
        return jp.getResource();
    }

    public static void main(String[] args) {
        JedisUtils.getJedis();
    }
}
